package com.eunion.web.admin.repository;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.eunion.web.admin.entity.AdminUserRole;
import com.eunion.web.common.base.BaseRepository;

/**
 * @see AdminUserRole .
 * 
 */
public interface AdminUserRoleRepository extends BaseRepository<AdminUserRole, Integer> {

	/**
	 * 根据username删除用户下面的角色.
	 * @param username 用户名
	 * @return　返回删除的个数？
	 */
	@Modifying
	@Query(value = "delete from admin_user_role where username = ?1 ", nativeQuery = true)
	int removeUserRoles(String username);

}
